Detection and repainting of semi-transparent overlays

ABSTRACT

A server includes at least one processor configured to execute a media application to provide media streaming that includes at least one video stream and at least one overlay on the at least one video stream. A portion of the media streaming is redirected by providing a placeholder to indicate positioning geometry of the at least one video stream within a media window, with the placeholder to include the at least one overlay. The processor detects the placeholder and determines positioning geometry associated therewith. A color and an alpha blending factor of the at least one overlay is determined based on calculations involving different colors of the at least one underlay at different times.

RELATED APPLICATIONS

This application is a continuation of application Ser. No. 16/228,945filed Dec. 21, 2018, which claims the benefit of provisional applicationSer. No. 62/667,013 filed May 4, 2018, which are hereby incorporatedherein in their entireties by reference.

TECHNICAL FIELD

The present disclosure generally relates to an applicationvirtualization platform allowing virtualized browser and desktopapplications to deliver optimized real time communications using astandard Web Real-Time Communication (WebRTC) API.

BACKGROUND

Traditionally, personal computers include combinations of operatingsystems, applications, and user settings, which are each managedindividually by owners or administrators on an ongoing basis. However,many organizations are now using desktop virtualization to provide amore flexible option to address the varying needs of their users. Indesktop virtualization, a user's computing environment (e.g., operatingsystem, applications, and/or user settings) may be separated from theuser's physical computing device (e.g., smartphone, laptop, desktopcomputer). Using client-server technology, a “virtualized desktop” maybe stored in and administered by a remote server, rather than in thelocal storage of the client computing device.

There are several different types of desktop virtualization systems. Asan example, Virtual Desktop Infrastructure (VDI) refers to the processof running a user desktop inside a virtual machine that resides on aserver. VDI and other server-based desktop virtualization systems mayprovide personalized desktops for each user, while allowing forcentralized management and security. Servers in such systems may includestorage for virtual desktop images and system configuration information,as well as software components to provide the virtual desktops and allowusers to interconnect to them. For example, a VDI server may include oneor more hypervisors (virtual machine managers) to create and maintainmultiple virtual machines, software to manage the hypervisor(s), aconnection broker, and software to provision and manage the virtualdesktops.

Desktop virtualization systems may be implemented using a singlevirtualization server or a combination of servers interconnected as aserver grid. For example, a cloud computing environment, or cloudsystem, may include a pool of computing resources (e.g., desktopvirtualization servers), storage disks, networking hardware, and otherphysical resources that may be used to provision virtual desktops, alongwith additional computing devices to provide management and customerportals for the cloud system.

Cloud systems may dynamically create and manage virtual machines forcustomers over a network, providing remote customers with computationalresources, data storage services, networking capabilities, and computerplatform and application support. For example, a customer in a cloudsystem may request a new virtual machine having a specified processorspeed and memory, and a specified amount of disk storage. Within thecloud system, a resource manager may select a set of available physicalresources from the cloud resource pool (e.g., servers, storage disks)and may provision and create a new virtual machine in accordance withthe customer's specified computing parameters. Cloud computing servicesmay service multiple customers with private and/or public components,and may be configured to provide various specific services, includingweb servers, security systems, development environments, userinterfaces, and the like.

SUMMARY

A server includes at least one processor configured to execute a mediaapplication to provide media streaming that includes at least one videostream and at least one overlay on the at least one video stream. Aportion of the media streaming is redirected by providing a placeholderto indicate positioning geometry of the at least one video stream withina media window, with the placeholder to include the at least oneoverlay. The processor detects the placeholder and determinespositioning geometry associated therewith. A color and an alpha blendingfactor of the at least one overlay is determined based on calculationsinvolving different colors of the at least one underlay at differenttimes.

The processor may be configured to determine the color and the alphablending factor of the at least one overlay based on calculationsinvolving the first color for the underlay of the placeholder at thefirst time, and the second color for the underlay of the placeholder atthe second time.

The processor may be further configured to provide the at least onevideo stream, the positioning geometry of the at least one placeholder,and the color and the alpha blending factor of the at least one overlayto a client device for the client device to overlay the at least onevideo stream over the at least one placeholder within a displayed mediawindow based on the positioning geometry, and to overlay the at leastone overlay in the color and alpha blending factor associated therewith.

The color and the alpha blending factor for the at least one overlay maybe determined for each pixel in the placeholder.

The color and the alpha blending factor for the at least one overlay maybe determined based on the following equations:

(pixel color at time 1)=(1−alpha)*(underlay color at time1)+alpha*(overlay color)

(pixel color at time 2)=(1−alpha)*(underlay color at time2)+alpha*(overlay color)

where alpha=1−(pixel color at time 2−pixel color at time 1)/(underlaycolor at time 2−underlay color at time 1);

where overlay color=(pixel color−(1−alpha)*underlay color)/alpha;

where pixel color corresponds to a blended color of the underlay colorand the at least one overlay color at time 1 or at time 2;

wherein alpha corresponds to the alpha blending factor; and

wherein the overlay color corresponds to the color of the at least oneoverlay.

The color and the alpha blending factor for the at least one overlay maybe determined based on the following equations:

The processor may be further configured to vary the first and secondcolors to improve color contrast between the underlay color and the atleast one overlay color.

The media application may comprise a real-time media applicationproviding real-time communications (RTC), and wherein the processor maybe further configured to redirect the portion of the real-time mediacommunications based on injected JavaScript code for WebRTC APIredirection.

The processor may be configured to redirect the portion of the mediastreaming based on at least one of the following: DirectShow filter,DirectX Media Object (DMO) filter, Media Foundation filter, HTML5 videoredirection module, Flash video redirection module, Browser HelperObject (BHO), browser extension.

The processor may be further configured to generate non-acceleratedgraphics for the redirected portion of the media streaming, and analyzethe non-accelerated graphics for the at least one placeholder and the atleast one overlay.

Another aspect is directed to a method comprising executing a mediaapplication to provide media streaming that includes at least one videostream and at least one overlay on the at least one video stream, andredirecting a portion of the media streaming by providing a placeholderto indicate positioning geometry of the at least one video stream withina media window. The placeholder may include the at least one overlay.The placeholder may be detecting and positioning geometry associatedtherewith may be determined. A color and an alpha blending factor of theat least one overlay may be determined based on calculations involvingdifferent colors of the at least one underlay at different times.

Yet another aspect is directed to a computing system comprising at leastone video source to provide at least one video stream, and a server asdefined above.

BRIEF DESCRIPTION OF THE DRAWINGS

The patent or application file contains at least one drawing executed incolor. Copies of this patent or patent application publication withcolor drawing(s) will be provided by the Office upon request and paymentof the necessary fee.

FIG. 1 is a block diagram of a network environment of computing devicesin which various aspects of the disclosure may be implemented.

FIG. 2 is a block diagram of a computing device useful for practicing anembodiment of the client machines or the remote machines illustrated inFIG. 1.

FIG. 3 is a block diagram of an architecture illustrating an applicationvirtualization platform that provides WebRTC API on the virtual desktopserver and executes the WebRTC API functionality on the client computingdevice in which various aspects of the disclosure may be implemented.

FIGS. 4-7 are various windows illustrating an example windowmonitoring/overlay detection scenario with the architecture illustratedin FIG. 3.

FIGS. 8-9 are updates to the window illustrated in FIG. 7 based onmovement of the server-side window.

FIGS. 10-11 are updates to the window illustrated in FIG. 9 based on arendered server-side application clipping a video stream.

FIG. 12 is a simplified block diagram of the architecture illustrated inFIG. 3 illustrating screen sharing with WebRTC API redirection.

FIG. 13 is a table diagram illustrating a method of detectingsemi-transparent overlays that can be used with the architectureillustrated in FIG. 3.

FIGS. 14-17 are sample images illustrating a test run of a method ofdetecting semi-transparent overlays that can be used with thearchitecture illustrated in FIG. 3.

FIG. 18 is a block diagram of the architecture illustrated in FIG. 3modified to support any accelerated graphics media that includes asemi-transparent overlay.

DETAILED DESCRIPTION

The present description is made with reference to the accompanyingdrawings, in which exemplary embodiments are shown. However, manydifferent embodiments may be used, and thus the description should notbe construed as limited to the particular embodiments set forth herein.Rather, these embodiments are provided so that this disclosure will bethorough and complete. Like numbers refer to like elements throughout,and prime notations are used to indicate similar elements in alternativeembodiments.

As will be appreciated by one of skill in the art upon reading thefollowing disclosure, various aspects described herein may be embodiedas a device, a method or a computer program product (e.g., anon-transitory computer-readable medium having computer executableinstruction for performing the noted operations or steps). Accordingly,those aspects may take the form of an entirely hardware embodiment, anentirely software embodiment or an embodiment combining software andhardware aspects.

Furthermore, such aspects may take the form of a computer programproduct stored by one or more computer-readable storage media havingcomputer-readable program code, or instructions, embodied in or on thestorage media. Any suitable computer readable storage media may beutilized, including hard disks, CD-ROMs, optical storage devices,magnetic storage devices, and/or any combination thereof.

Referring initially to FIG. 1, a non-limiting network environment 101 inwhich various aspects of the disclosure may be implemented includes oneor more client machines 102A-102N, one or more remote machines106A-106N, one or more networks 104, 104′, and one or more appliances108 installed within the computing environment 101. The client machines102A-102N communicate with the remote machines 106A-106N via thenetworks 104, 104′.

In some embodiments, the client machines 102A-102N communicate with theremote machines 106A-106N via an intermediary appliance 108. Theillustrated appliance 108 is positioned between the networks 104, 104′and may be referred to as a network interface or gateway. In someembodiments, the appliance 108 may operate as an application deliverycontroller (ADC) to provide clients with access to business applicationsand other data deployed in a datacenter, the cloud, or delivered asSoftware as a Service (SaaS) across a range of client devices, and/orprovide other functionality such as load balancing, etc. In someembodiments, multiple appliances 108 may be used, and the appliance(s)108 may be deployed as part of the network 104 and/or 104′.

The client machines 102A-102N may be generally referred to as clientmachines 102, local machines 102, clients 102, client nodes 102, clientcomputers 102, client devices 102, computing devices 102, endpoints 102,or endpoint nodes 102. The remote machines 106A-106N may be generallyreferred to as servers 106 or a server farm 106. In some embodiments, aclient device 102 may have the capacity to function as both a clientnode seeking access to resources provided by a server 106 and as aserver 106 providing access to hosted resources for other client devices102A-102N. The networks 104, 104′ may be generally referred to as anetwork 104. The networks 104 may be configured in any combination ofwired and wireless networks.

A server 106 may be any server type such as, for example: a file server;an application server; a web server; a proxy server; an appliance; anetwork appliance; a gateway; an application gateway; a gateway server;a virtualization server; a deployment server; a Secure Sockets LayerVirtual Private Network (SSL VPN) server; a firewall; a web server; aserver executing an active directory; or a server executing anapplication acceleration program that provides firewall functionality,application functionality, or load balancing functionality.

A server 106 may execute, operate or otherwise provide an applicationthat may be any one of the following: software; a program; executableinstructions; a virtual machine; a hypervisor; a web browser; aweb-based client; a client-server application; a thin-client computingclient; an ActiveX control; a Java applet; software related to voiceover internet protocol (VoIP) communications like a soft IP telephone;an application for streaming video and/or audio; an application forfacilitating real-time-data communications; a HTTP client; a FTP client;an Oscar client; a Telnet client; or any other set of executableinstructions.

In some embodiments, a server 106 may execute a remote presentationservices program or other program that uses a thin-client or aremote-display protocol to capture display output generated by anapplication executing on a server 106 and transmit the applicationdisplay output to a client device 102.

In yet other embodiments, a server 106 may execute a virtual machineproviding, to a user of a client device 102, access to a computingenvironment. The client device 102 may be a virtual machine. The virtualmachine may be managed by, for example, a hypervisor, a virtual machinemanager (VMM), or any other hardware virtualization technique within theserver 106.

In some embodiments, the network 104 may be: a local-area network (LAN);a metropolitan area network (MAN); a wide area network (WAN); a primarypublic network 104; and a primary private network 104. Additionalembodiments may include a network 104 of mobile telephone networks thatuse various protocols to communicate among mobile devices. For shortrange communications within a wireless local area network (WLAN), theprotocols may include 802.11, Bluetooth, and Near Field Communication(NFC).

FIG. 2 depicts a block diagram of a computing device 100 useful forpracticing an embodiment of client devices 102 or servers 106. Thecomputing device 100 includes one or more processors 103, volatilememory 122 (e.g., random access memory (RAM)), non-volatile memory 128,user interface (UI) 123, one or more communications interfaces 118, anda communications bus 150.

The non-volatile memory 128 may include: one or more hard disk drives(HDDs) or other magnetic or optical storage media; one or more solidstate drives (SSDs), such as a flash drive or other solid state storagemedia; one or more hybrid magnetic and solid state drives; and/or one ormore virtual storage volumes, such as a cloud storage, or a combinationof such physical storage volumes and virtual storage volumes or arraysthereof.

The user interface 123 may include a graphical user interface (GUI) 124(e.g., a touchscreen, a display, etc.) and one or more input/output(I/O) devices 126 (e.g., a mouse, a keyboard, a microphone, one or morespeakers, one or more cameras, one or more biometric scanners, one ormore environmental sensors, and one or more accelerometers, etc.).

The non-volatile memory 128 stores an operating system 115, one or moreapplications 116, and data 117 such that, for example, computerinstructions of the operating system 115 and/or the applications 116 areexecuted by processor(s) 103 out of the volatile memory 122. In someembodiments, the volatile memory 122 may include one or more types ofRAM and/or a cache memory that may offer a faster response time than amain memory. Data may be entered using an input device of the GUI 124 orreceived from the I/O device(s) 126. Various elements of the computer100 may communicate via the communications bus 150.

The illustrated computing device 100 is shown merely as an exampleclient device or server, and may be implemented by any computing orprocessing environment with any type of machine or set of machines thatmay have suitable hardware and/or software capable of operating asdescribed herein.

The processor(s) 103 may be implemented by one or more programmableprocessors to execute one or more executable instructions, such as acomputer program, to perform the functions of the system. As usedherein, the term “processor” describes circuitry that performs afunction, an operation, or a sequence of operations. The function,operation, or sequence of operations may be hard coded into thecircuitry or soft coded by way of instructions held in a memory deviceand executed by the circuitry. A processor may perform the function,operation, or sequence of operations using digital values and/or usinganalog signals.

In some embodiments, the processor can be embodied in one or moreapplication specific integrated circuits (ASICs), microprocessors,digital signal processors (DSPs), graphics processing units (GPUs),microcontrollers, field programmable gate arrays (FPGAs), programmablelogic arrays (PLAs), multi-core processors, or general-purpose computerswith associated memory.

The processor may be analog, digital or mixed-signal. In someembodiments, the processor may be one or more physical processors, orone or more virtual (e.g., remotely located or cloud) processors. Aprocessor including multiple processor cores and/or multiple processorsmay provide functionality for parallel, simultaneous execution ofinstructions or for parallel, simultaneous execution of one instructionon more than one piece of data.

The communications interfaces 118 may include one or more interfaces toenable the computing device 100 to access a computer network such as aLocal Area Network (LAN), a Wide Area Network (WAN), a Personal AreaNetwork (PAN), or the Internet through a variety of wired and/orwireless connections, including cellular connections.

In described embodiments, the computing device 100 may execute anapplication on behalf of a user of a client device. For example, thecomputing device 100 may execute one or more virtual machines managed bya hypervisor. Each virtual machine may provide an execution sessionwithin which applications execute on behalf of a user or a clientdevice, such as a hosted desktop session. The computing device 100 mayalso execute a terminal services session to provide a hosted desktopenvironment. The computing device 100 may provide access to a remotecomputing environment including one or more applications, one or moredesktop applications, and one or more desktop sessions in which one ormore applications may execute.

Additional descriptions of a computing device 100 configured as a clientdevice 102 or as a server 106, or as an appliance intermediary to aclient device 102 and a server 106, and operations thereof, may be foundin U.S. Pat. Nos. 9,176,744 and 9,538,345, which are incorporated hereinby reference in their entirety. The '744 and '345 patents are bothassigned to the current assignee of the present disclosure.

Turning now to FIG. 3, the illustrated architecture 300 will bediscussed in terms of WebRTC redirection with interception techniques.The architecture 300 allows virtualized browser and desktop applicationsto deliver optimized real time communications (RTC) using a standardWebRTC API. Real time communications includes voice, video and datacollaboration. An application framework 312 provides the WebRTC API onthe application server 302, and provides execution of the WebRTC APIfunctionality on the remote client 304. Various techniques are used tomake this functionality feasible and transparent to the real-time mediaapplication 310, and achieve high quality user experience and otherdesirable features.

The application framework 312 includes a web browser or a desktopapplication to provide the real-time media application 310 that providesthe real time communications. The real-time media application 310 issupported by a real-time media application server 320. The architecture300 may be referred to as a computing system 300, the application server302 may be referred to as a virtual desktop server 302, and the remoteclient 304 may be referred to as a client computing device 304 or as avirtual desktop client 304. The client computing device 304 is inpeer-to-peer communications with at least one other client computingdevice 305.

WebRTC is a collection of APIs and an open source project enablingreal-time communications (VoIP, video over IP, and other types ofreal-time collaboration) in browser and desktop applications. Since itsintroduction to the industry by Google in 2011, and adoption by severalstandards bodies (W3C and IETF), WebRTC has been included in mostpopular web browsers, as well as made available in desktop applicationplatforms such as Electron. Application and service vendors as well asenterprise IT departments are increasingly making use of WebRTC foradding voice and video functionality to existing and new HTML5applications.

Electron is an open source framework for building desktop applications(running outside of a browser) using technologies originally defined forthe Web, including HTML5 and WebRTC. Electron is also seeing increasedadoption in the industry by leading application vendors.

Under desktop virtualization, execution of WebRTC functionality on thevirtual desktop server 302 has a number of well-known disadvantages. Onedisadvantage is the high latency and low media quality introduced byvirtualization of audio and video devices, which involves several roundsof media compression/decompression and extra network hops. Anotherdisadvantage is network and server scalability concerns caused bymandatory tunneling of peer-to-peer media through the data center or thecloud infrastructure, and running high CPU cost audio and video codecson the virtual desktop server 302.

Execution of real-time functionality, including both the mediaprocessing pipelines and the networking code, by a client RTC API engine308 on the client computing device 304 addresses these problems. It isstill advantageous to run the rest of the real-time media applicationcode on the virtual desktop server 302, using a native RTC engine 316where it can integrate with other desktop applications and other desktopOS functionality. Redirection of WebRTC APIs provides a way for thereal-time media application code to continue executing on the virtualdesktop server 302, while offloading only real-time media processing andnetworking to the client computing device 304. Further, the real-timemedia application code can be largely unaware of the fact that WebRTCAPIs are being redirected. This results in out of the box real-timemedia optimization for many if not all virtualized applications.

Redirection, or remoting, of parts of application functionality from thevirtual desktop server 302 to the client computing device 304 is not newby itself, and has been implemented in a number of technologies(including such Citrix technologies as Remoting Audio and VideoExtensions (RAVE), Flash Redirection, Browser Content Redirection, andReal-time Optimization Pack). However, what is new is using WebRTCredirection techniques to deliver real-time media optimization for HTML5/JavaScript applications.

WebRTC redirection techniques include a number of unique features suchas: new methods of API interception for browser and desktopapplications; new techniques for providing fallback functionality; newtechniques for video area identification and geometry tracking; newtechniques for window monitoring/overlay detection; new techniques forselecting and capturing screen content for content sharing sessions; newtypes and applications of policies to control application access toendpoint media sources; and new techniques for managing networkconnectivity for real time media in virtualization applicationenvironments. These techniques are discussed in more detail below.

As a general overview, WebRTC comprises a set of API specificationsmaintained by the Web Real-Time Communications Working Group (part ofW3C), as well as implementations of these APIs in web browsers andHTML5/JavaScript desktop application platforms such as Electron. Themost relevant specifications for this architecture include WebRTC 1.0:Real-time Communication Between Browsers (further referenced as[webrtc]), Media Capture and Streams ([mediacapture-streams]), andScreen Capture ([screen-capture]). The following description referencesdefinitions and API elements from relevant W3C specifications withoutrepeating them here.

The general idea of the illustrated architecture 300 in FIG. 3 is toredirect underlying functionality of WebRTC APIs from the virtualdesktop server 302 to the client computing device 304 by interceptingcalls to the API made by the real-time media application 310. Theintercepted APIs are executed either remotely on the client computingdevice 304 via the client RTC API engine 308, or locally on the virtualdesktop server 302 as appropriate via the native RTC engine 316. APIcallbacks are invoked or asynchronous API events are generated to thereal-time media application 310.

Acronyms and definitions in this field include XenApp (XA), XenDesktop(XD), and Virtual Desktop Infrastructure (VDI). VDI is virtualizationtechnology that hosts a desktop operating system on a centralized serverin a data center, and provides remote access to virtual hostedapplications and desktops. Citrix Receiver and Citrix Workspace App arevirtual desktop clients providing remote access to virtual hostedapplications and desktops.

The following major elements comprise the system architecture 300 forWebRTC redirection. A virtual desktop server 302 provides server-sidevirtual channel functionality and hosts virtual applications. Forexample, these may be implemented in Citrix XenApp/XenDesktop. A virtualdesktop client 304 provides client-side virtual channel functionality.For example, this may be implemented in Citrix Receiver and CitrixWorkspace App. A virtualized application (or virtual application) is athird party application implemented in HTML 5 and JavaScript and usesWebRTC to deliver real-time voice, video and data functionality. Thevirtualized application, such as the real-time media application 310, ishosted on the virtual desktop server 302.

A server-side API code redirection module 306 includes code librariesand applications running on the virtual desktop server 302, andinteracts with the real-time media application 310 to achieve WebRTC APIredirection. The API code redirection module 306 may be referred to as aWebRTC API connector 306. The API code redirection module 306 may beconsidered as a single system component, or may be split into twosubcomponents: injected and non-injected code, for some of thetechniques described below.

Injected server-side WebRTC connector code 314 (injected API code)includes portions of connector code that may be either implemented inJavaScript, or implemented in a different computer language butproviding a JavaScript-compatible API. The injected API code 314 isinjected into the real-time media application 310, and modifies theHTML5/JavaScript execution environment within the application process.If implemented in JavaScript, the injected code 314 would communicatewith non-injected connector code libraries directly using WebSockets oranother suitable inter-process communication mechanism, and indirectlythrough rendered screen contents as described below in the windowtracking section.

Other server-side connector code includes code libraries implemented inany suitable programming language and running either within or outsideof the application process. The API code redirection module 306communicates with the injected code 314 through WebSockets or anothersuitable mechanism, and indirectly through screen capture, and with theclient RTC API engine 308 through a virtual channel 318.

The client RTC API engine 308 includes code libraries running on theclient computing device 304. The client RTC API engine 308 communicateswith the API code redirection module 306 through a virtual channel 318hosted by the virtual desktop server 302.

The illustrated architecture 300, and the general idea of optimizingapplication virtualization by offloading parts of the real-time mediaapplication RTC functionality from the virtual desktop server 302 to theclient computing device 304, are fairly generic and widely used insystems implementing application or desktop virtualization. Thedistinction hereinlies in specific functions and interactions of theinjected code 314, the API code redirection module 306, and the clientRTC API engine 308 that are designed to optimize real time media APIs.In particular, WebRTC is optimized.

As noted above, the computing system 300 includes the virtual desktopserver 302 and the client computing device 304 in peer-to-peercommunications with another endpoint device 305. The virtual desktopserver 302 includes the application framework 312 that includes thereal-time media application 310 to provide real-time communications(RTC), and the native RTC engine 316 to execute a portion of thereal-time media application 310 when received by the native RTC engine316. The API code redirection module 306 redirects intercepted APIs ofthe real-time media application 310 intended for the native RTC engine316 based on redirection code 314 injected into the real-time mediaapplication 310 so that the portion of the real-time media application310 is redirected. The client RTC API engine 308 in the client computingdevice 304 communicates with the API code redirection module 306 througha virtual channel 318 to execute the redirected portion of the real-timemedia application 310.

The application framework 312 may be a web browser or a desktopapplication framework. The redirected APIs correspond to real-time mediaprocessing and/or peer-to-peer networking with another client computingdevice 305.

Various API interception techniques will now be discussed. WebRTC APIsare defined as Java Script APIs available to HTML 5/Java Scriptapplications within a web browser or within an application developmentplatform such as Electron. Electron combines an HTML 5/Java Scriptapplication engine with additional desktop-specific platformfunctionality. Interception of WebRTC APIs by a desktop virtualizationplatform requires additional novel techniques.

The following API interception techniques will be discussed below:hooking; use of a custom browser; JavaScript injection via proxy;JavaScript injection via a browser helper object (BHO) or browserextension, JavaScript injection via micro-VPN plugin; and use of anelectron app decomposition.

For hooking, the API code redirection module 306 may include a hookingmodule configured to intercept the APIs of the real-time mediaapplication 310 based on hooking, and inject the redirection code 314into the real-time media application 310 based on the intercepted APIs.

JavaScript rendered DLL APIs are hooked and custom JS is inserted. ForIE, the JavaScript engine DLL is jscript.dll and is a (in process) COMobject server. Hence, the idea would be to employ standard COM shimmingtechniques to operate as a “man in the middle” (MITM) in order to insertcustom JavaScript. In the IE JavaScript engine, all JavaScript objectsimplement the IDispatchEx interface. Alternatively, one could hook OSsocket APIs, e.g. WinSock APIs, parse HTTP traffic and HTML content andthen insert JS.

For a custom browser, a custom Chromium-based browser engine may be usedand a custom Secure Browser published, e.g., as part of the CitrixSecure Browser Cloud Service. Hooks or plugins are used within theChromium engine to inject custom JS. Alternatively, a custom browserengine may implement some or all of the WebRTC redirection functionalityin native code, limiting or removing the need to inject customJavaScript code. The virtual desktop server 302 includes a browser thatincludes hooks or plug-ins configured to intercept the APIs of thereal-time media application 310, and inject the redirection code 314into the real-time media application 310 based on the intercepted APIs.

For JavaScript injection via proxy, a proxy is used to intercept HTMLcontent. The proxy would add additional JS via content rewriting. Theproxy could be a separate appliance on the network, or reside on thevirtual desktop server 302. The proxy could be configured explicitly(using browser settings) or operate as a transparent proxy.

In one approach, the computing system 300 further includes a proxyserver configured to intercept HTML content from a web server to beretrieved by the real-time media application 310, and re-write theintercepted HTML content so that execution of the re-written HTMLcontent causes the APIs of the real-time media application 310 to beintercepted. The redirection code 314 is then injected into thereal-time media application 310 based on the intercepted APIs.

In another approach, the proxy server may be configured to interceptHTML content from a web server to be retrieved by the real-time mediaapplication 310, and inject code into pages of the intercepted HTMLcontent. Execution of the pages with the injected code causes the APIsof the real-time media application 310 to be intercepted. Theredirection code 314 is then injected into the real-time mediaapplication 310 based on the intercepted APIs.

For JavaScript injection via Browser Helper Object (BHO) or browserextension, JavaScript code to implement WebRTC API redirection could beinjected into a browser-based application using the BHO or the BrowserExtension for web browsers that implement BHO or browser extensionmechanisms. The virtual desktop server 302 thus includes a browserincluding a BHO or a Browser Extension to intercept the APIs of thereal-time media application 310, and inject the redirection 314 codeinto the real-time media application 310 based on the intercepted APIs.

For JavaScript injection via micro-VPN plugin, a universal windowsplatform (UWP) App is used to implement a virtual private network (VPN)app plugin. The UWP VPN plugin app will handle the declaration of theVPN client plug-in capability in the AppX manifest and provide referenceto the VPN plug-in app handler. Running the plugin within a sandbox (appcontainer) allows for greater security and reduced complexity of theimplementation.

The VPN app plugin is able to control VPN connections in conjunctionwith the OS VPN platform. In addition, the VPN app plugin could beconfigured as a micro-VPN, i.e., it can be applied on a per-applicationbasis. For example, the configuration could be achieved via mobiledevice management (MDM) or mobile application management (MDM) policies.

Alternatively, a custom profile may be created using PowerShell scripts.The configuration could specify apps whose traffic is to be managed bythe micro-VPN plugin. In particular, the micro-VPN plugin could beconfigured for browser applications and Electron based apps. Themicro-VPN plugin could be enabled to intercept network traffic for allor specific apps, decrypt TLS using local certificate store, parse HTTPtraffic and HTML content and then insert custom JavaScript.

In one approach, the computing system further includes a micro-virtualprivate network (VPN) plug-in configured to intercept HTML content froma web server to be retrieved by the real-time media application 310, andre-write the intercepted HTML content so that execution of there-written HTML content causes the APIs of the real-time mediaapplication 310 to be intercepted. Then the redirection code 314 is tobe injected into the real-time media application 310 based on theintercepted APIs.

In another approach, the micro-virtual private network (VPN) plug-in maybe configured to intercept HTML content from a web server to beretrieved by the real-time media application 310, and inject code intopages of the intercepted HTML content. Execution of the pages with theinjected code causes the APIs of the real-time media application 310 tobe intercepted. The redirection code 314 is then injected into thereal-time media application 310 based on the intercepted APIs.

For electron app decomposition, the electron app is first run through atool that modifies the electron app. The modification is based ondecomposing binaries of the electron application to access the APIs ofthe real-time media application 310, add hooks to inject the redirectioncode into the real-time media application 310 based on the interceptedAPIs, repackage the electron application binaries, and resign theelectron application. The modified electron application is thenconfigured to intercept the APIs of the real-time media application 310based on hooking, and inject the redirection code 314 into the real-timemedia application 310 based on the intercepted APIs. Stated another way,the electron app is detected during virtual app publishing.

Electron app binaries are then decomposed. App content is usuallylocated within an .asar archive located within a subfolder correspondingto the electron application. It is possible to unpack this archive usingasar.exe (available as a node.js package) to access the JavaScript codefor the application. Then hooks are added where the hooks comprise DLLsor other modules are to be loaded at runtime and to inject custom JS.The import address table of the main executable is modified to load thehooks when a process runs. The application binaries are repackaged, andthe electron application package is then resigned.

Another aspect of delivering optimized real time communications (RTC)using a standard WebRTC API is directed to a method for operating acomputing system 300 comprising a virtual desktop server 302 and aclient computing device 304 comprising a client RTC API engine 308. Thevirtual desktop server 302 includes an application framework 312 and anAPI code redirection module 306. The application framework 312 includesa real-time media application 310 and a native RTC engine 316.

The method includes providing real-time communications based onoperation of the real-time media application 310, with a portion of thereal-time media application 310 to be executed by the native RTC engine316 when received by the native RTC engine 316. The method furtherincludes redirecting by the API code redirection module 306 interceptedAPIs of the real-time media application 310 intended for the native RTCengine 316 based on redirection code 314 injected into the real-timemedia application 310 so that the portion of the real-time mediaapplication 310 is redirected. The client RTC API engine 308communicates with the API code redirection module 306 through a virtualchannel 318 to execute the redirected portion of the real-time mediaapplication 310.

Yet another aspect is directed to a non-transitory computer readablemedium for operating a virtual desktop server 302 within a computingsystem 300 as described above. The non-transitory computer readablemedium has a plurality of computer executable instructions for causingthe virtual desktop server 302 to provide real-time communications (RTC)based on operation of the real-time media application 310, with aportion of the real-time media application 310 to be executed by thenative RTC engine 316 when received by the native RTC engine 316. Theinstructions further cause the virtual desktop server 302 to redirect bythe API code redirection module 306 intercepted APIs of the real-timemedia application 310 intended for the native RTC engine 316 based onredirection code 314 injected into the real-time media application 310so that the client RTC API engine 308 communicates with the API coderedirection module 306 through a virtual channel 318 to execute theredirected portion of the real-time media application 310.

Still referring to FIG. 3, the illustrated computing system 300 will nowbe discussed in terms of WebRTC redirection with fallback. Generalfallback techniques will now be discussed where in some cases thenecessary functionality will be missing so a graceful fallbackfunctionality to use less optimized mechanisms is needed for handlingreal time media when full optimization is not available.

The virtual desktop server 302 and the at least one client computingdevice 304 are as discussed above. The application framework 312includes the real-time media application 310 to provide real-timecommunications (RTC), and the native RTC engine 316 executes a portionof the real-time media application 310 when received by the native RTCengine 306. The virtual desktop server 302 further includes an API coderedirection module 306 to redirect original APIs of the real-time mediaapplication 310 intended for the native RTC engine 316 based onredirection code 314 injected into the real-time media application 310so that the portion of the real-time media application 310 is to beredirected.

In particular, the client computing device 304 includes the client RTCAPI engine 308 reporting to the API code redirection module 306 througha virtual channel 318 on capabilities of the client computing device 304to execute the redirected portion of the real-time media application310. The API code redirection module 306 switches to a fallback mode ifthe client computing device 304 has limited capabilities. In thefallback mode at least part of the original APIs are used so that thenative RTC engine 316 executes at least part of the portion of thereal-time media application 310.

Real time media functionality enabled by WebRTC redirection describedhere will result in optimized user experience and system scalabilitywhen all system components include the necessary functionality. Inparticular, when virtual desktop clients and servers include compatiblesoftware and hardware modules that have the necessary capabilitiescooperate to deliver the functionality as designed.

If the client computing device 304 has full capabilities fallback is notneeded. In this case, the API code redirection module 306 does notswitch to the fallback mode so that the client RTC API engine 308executes all of the redirected portion of the real-time mediaapplication 310.

However, in real world deployments, it is inevitable that in some casesthe necessary functionality will be missing. A WebRTC remoting solutionmust provide graceful fallback functionality to use other, lessoptimized mechanisms for handling real time media when full optimizationis not available. Ideally, this fallback functionality (as well as theoptimization itself) should be transparent to the application, i.e.,handled by the application framework 312 without requiring applicationchanges, and provide a friendly user experience.

To provide fallback functionality, a virtual application solution needsto include some or all of session state tracking and capabilitydetection and negotiation.

In session state tracking, application process lifetime may overlap withone or more user connections to a virtual access session, and theprocess of enabling optimized functionality or providing a fallback mayhappen multiple times as session state changes.

In capability detection and negotiation, client-server protocols usedfor providing optimized functionality need to support detection ornegotiation of the virtual desktop server 302 and client computingdevice 304 capabilities, which enables the corresponding code to switchbetween optimized and fallback modes of operation.

When fallback is needed, then the following techniques are specific toproviding fallback functionality for WebRTC redirection. Thesetechniques include 1) fallback to the built-in native RTC engine 316; 2)per-modality fallback; 3) partial fallback; and 4) mapping of sessionconnect/disconnect events to device availability events.

In fallback to the built-in native RTC engine 316, the client computingdevice 304 has no capabilities to execute the redirected portion of thereal-time media application 310. In the fallback mode all of theoriginal APIs are used so that the native RTC engine 316 executes all ofthe portion of the real-time media application 310 instead of the clientRTC API engine 308.

When remote execution of WebRTC is not possible (e.g., when no clientRTC API engine 308 is present), injected code can dynamically dispatchapplication API calls to the built-in native RTC engine 316 that isincluded as part of the application framework 312. Injected code 314 canuse itself as a shim to monitor these calls and resulting built-inWebRTC objects are used to enable an eventual switch to remote(optimized) functionality as well as ongoing monitoring of applicationWebRTC usage and quality.

In the per-modality fallback, depending on client computing device 304capabilities and policies, the application framework 312 may implementper-modality fallback functionality when a remaining part of the portionof the real-time media application 310 that is not executed by thenative RTC engine 316 is redirected to the client RTC API engine 308 forexecution.

For example, when a client computing device 304 can only handle theaudio portion of a real-time media session, the application framework312 may implement optimized functionality for audio and fallbackfunctionality for video. To do this, injected code 314 can remote APIcalls for audio streams to the client computing device 304 and redirectAPI calls for video streams to the local built-in RTC engine 316,merging the results together. The at least part of the portion of thereal-time media application 310 executed by the native RTC engine 316corresponds to video, and the remaining part of the portion of thereal-time media application 310 executed by the client RTC API engine308 corresponds to audio.

Alternatively, the at least part of the portion of the real-time mediaapplication 310 executed by the native RTC engine 316 corresponds toaudio, and the remaining part of the portion of the real-time mediaapplication 310 executed by the client RTC API engine 308 corresponds tovideo.

In the partial fallback, depending on the virtual desktop server 302capabilities and policies, injected and server-side code can implementpartial fallback. Partial fallback does not involve redirection to theclient computing device 304. Instead, the capabilities of the virtualdesktop server 302 are reduced.

In an optimized mode the WebRTC redirection framework may support audio,video, and data communications. In the partial fallback mode theframework may only provide audio and video if the server-side CPUutilization on a multi-user server does not exceed a certain value. Ifthe certain value is exceeded, then video support is automaticallyturned off under high CPU load to avoid quality problems. Similarfallback restrictions can be implemented by monitoring media quality forfallback sessions, and disabling some functionality if quality stays orfalls below a defined threshold.

In other words, if the client computing device 304 has limitedcapabilities and the API code redirection module 306 determines that thevirtual desktop sever 302 also has limited capabilities, then the APIcode redirection module 306 does not switch to the fallback mode for atleast a part of the portion of the real-time media application 310, andthe at least part of the portion of the real-time media application 310is not executed by neither the client RTC API engine 308 nor the nativeRTC engine 316.

For example, the at least part of the portion of the real-time mediaapplication 310 that is not executed by neither the client RTC APIengine 308 nor the native RTC engine 316 may correspond to video, whilethe remaining part of the portion of the real-time media application 310is executed by either the client RTC API engine 308 or the native RTCengine 316 in fallback mode and may correspond to at least one of audioand data communications.

As another example, the API code redirection module 306 may determinethat the virtual desktop sever 302 also has limited capabilities basedon at least one of client computing device 304 policies, virtual desktopsever 302 policies, virtual desktop sever 302 CPU load, and mediaquality.

In this case, if the client computing device 304 has limitedcapabilities and the API code redirection module 306 determines that thevirtual desktop sever 302 also has limited capabilities, then the APIcode redirection module 306 does not switch to the fallback mode for atleast a part of the portion of the real-time media application 310. Theat least part of the portion of the real-time media application 310 isnot executed by neither the client RTC API engine 308 nor the native RTCengine 316.

The at least part of the portion of the real-time media application 310that is not executed by neither the client RTC API engine 308 nor thenative RTC engine 316 corresponds to video, and the remaining part ofthe portion of the real-time media application 310 is executed by eitherthe client RTC API engine 308 or the native RTC engine 316 in fallbackmode and corresponds to at least one of audio and data communications.

The API code redirection module 306 determines that the virtual desktopsever 302 also has limited capabilities based on at least one of clientcomputing device policies, virtual desktop sever policies, virtualdesktop sever CPU load, and media quality.

In the mapping of session connect/disconnect events to deviceavailability events, WebRTC includes a subset of APIs(NavigatorUserMedia, getUserMedia) enabling applications to enumeratelocal media devices, request access to a local media device (such as amicrophone or a camera), and use it for a real-time media session. UnderWebRTC redirection, the corresponding APIs will respectively enumerate,obtain access to, and request usage of, devices physically attached tothe client computer.

To handle fallback scenarios, upon session disconnection, injected codewill update internal data structures and generate events indicating tothe application that all devices have been physically disconnected. Uponsession reconnection and after successful capability negotiation, thiscode will indicate to the real-time media application 310 that newdevices are now available.

Upon fallback, injected code will defer to the built-in WebRTC engine316 to enumerate local devices, which may in turn invoke other virtualchannel functionality to enumerate client devices and performnon-optimized redirection. For example, this may be via generic audioredirection or graphics remoting virtual channels. With this approach,the application designed properly to handle local media deviceavailability will not require any special logic to process sessionconnect/disconnect and fallback events.

In one aspect, the virtual desktop server 302 enumerates devicesphysically connected to the client computing device 304 when the clientcomputing device 304 is connected to the virtual desktop server 302.When the client computing device 304 is disconnected from the virtualdesktop server 302, then the injected code 314 generates eventsindicating to the real-time media application 310 that all devices havebeen physically disconnected.

Upon reconnection of the client computing device 304 to the virtualdesktop server 302, the injected code 314 indicates to the real-timemedia application 310 that new devices are now available. Upon fallback,the injected code 314 defers to the native RTC engine 316 to enumeratethe devices physically connected to the client computing device 304.

Another aspect of providing fallback functionality to use less optimizedmechanisms for handling real time media when full optimization is notavailable is directed to a method for operating a computing system 300comprising a virtual desktop server 302 and a client computing device304 that includes a client RTC API engine 308. The virtual desktopserver 302 includes an application framework 312 and an API coderedirection module 306. The application framework 312 includes areal-time media application 310 and a native RTC engine 316.

The method includes providing real-time communications (RTC) based onoperation of the real-time media application 310, with a portion of thereal-time media application to be executed by the native RTC engine whenreceived by the native RTC engine, and redirecting by the API coderedirection module 306 original APIs of the real-time media application310 intended for the native RTC engine 316 based on redirection code 314injected into the real-time media application 310 so that the portion ofthe real-time media application 310 is to be redirected.

The method further includes reporting by the client RTC API engine 308to the API code redirection module 306 through a virtual channel 318 oncapabilities of the client computing device 304 to execute theredirected portion of the real-time media application 310. The API coderedirection module 306 is operated to switch to a fallback mode if theclient computing device 304 has limited capabilities, where in thefallback mode at least part of the original APIs are used so that thenative RTC engine 316 executes at least part of the portion of thereal-time media application 310.

Yet another aspect is directed to a non-transitory computer readablemedium for operating a virtual desktop server 302 within a computingsystem 300 as described above. The non-transitory computer readablemedium has a plurality of computer executable instructions for causingthe virtual desktop server 302 to provide real-time communications (RTC)based on operation of the real-time media application 310, with aportion of the real-time media application 310 to be executed by thenative RTC engine 316 when received by the native RTC engine 316. Theinstructions further cause the virtual desktop server 302 to redirect bythe API code redirection module 306 intercepted APIs of the real-timemedia application 310 intended for the native RTC engine 316 based onredirection code 314 so that the portion of the real-time mediaapplication 310 is to be redirected. The API code redirection module 306receives from the client RTC API engine 308 through a virtual channel318 capabilities of the client computing device to execute theredirected portion of the real-time media application 310. The API coderedirection module 306 is operated to switch to a fallback mode if theclient computing device 304 has limited capabilities, where in thefallback mode at least part of the original APIs are used so that thenative RTC engine 316 executes at least part of the portion of thereal-time media application 310.

Still referring to FIG. 3, the illustrated computing system 300 will benow discussed in terms of WebRTC redirection with windowmonitoring/overlay detection. As will be discussed in detail below,geometry tracking is used to seamlessly provide redirection of WebRTCfunctionality. Applications using WebRTC typically render received videostreams by connecting a MediaStream object to an HTML5 video element.Visibility and geometry of this element is usually managed by theapplication directly or using CSS style information.

Applications often create and position other UI elements (e.g., labelsor control buttons) so that they visually overlap with the video, andmay use transparency to blend rendered video with application UIcontent. The UI elements may be referred to as non-accelerated graphics,and the video may be referred to as accelerated graphics. Anapplication, such as the real-time media application 310, may have morethan one active video element rendering real-time video at the same time(e.g., one or more remote video feeds from video conference participantsand a self-view from a local camera 330).

To achieve seamless redirection of WebRTC functionality, the applicationvirtualization framework on the virtual desktop server 302 needs toidentify and keep track of visibility and geometry of several videoelements, as well as any other elements that overlay live video. Whenthis information is available, WebRTC redirection code on the clientcomputing device 304 will use it to create, position and clip localvideo rendering windows, and possibly render opaque or transparentoverlays on top of these windows to represent corresponding applicationUI elements.

Geometry tracking for HTML5 video elements may be via color or patterndetection. Positioning and rendering of video and other UI elements inWebRTC applications is handled by the HTML rendering engine embedded inthe browser or application framework, and is typically not readilyavailable through an API or other means of introspection outside of theHTML renderer.

One possible way to overcome this limitation and identify multiple HTML5video areas and track their geometry includes the following steps. Onestep is to use injected code 314 to assign each video element a uniqueID at the point when the real-time media application 310 makes an APIcall to connect a redirected Media Stream with a particular videoelement. Also, the injected code 314 causes each video area to bepainted with a color or a pattern derived from the video element ID. Forexample, this may include encoding bits of the element ID in bits ofvideo area color for uniform painting, or in colors of adjacent pixelsfor pattern painting.

Another possibility is to paint the video area using a 1-D or 2-D barcode encoding the video element ID. In the graphics capture and remotingcode (part of the application virtualization code), video overlay areasare detected by color, pattern, or bar code using any of the availabletechniques for pixel color or area pattern matching or bar codescanning.

Detected areas may be non-rectangular or may be partially clipped. Toachieve correct geometry tracking, it will be necessary to combine theinformation retrieved from injected code (video element ID and size inpixels) with results of colored or patterned area detection to determinethe size and clipping geometry of each individual video element. Toimprove performance, results of video area detection can be cached andonly partially recalculated for subsequent frames.

The illustrated computing system 300 includes at least one video source330 to provide at least one video stream, the virtual desktop server 302and the at least one client computing device 304 as discussed above. Thevirtual desktop server 302 includes the application framework 312 thatincludes the real-time media application 310 to provide real-timecommunications (RTC), and the native RTC engine 316 to execute a portionof the real-time media application 310 when received by the native RTCengine 316.

The API code redirection module 306 redirects intercepted APIs of thereal-time media application 310 intended for the native RTC engine 316based on redirection code 314 injected into the real-time mediaapplication 310 so that the portion of the real-time media application310 is redirected. In particular, the injected redirection code 314defines at least one placeholder to indicate positioning geometry of theat least one video stream within an RTC window. A geometry trackingmodule 332 detects the at least one placeholder within the injectedredirection code 314, and provides the positioning geometry associatedtherewith.

The client computing device 304 includes a display 334 to display theRTC window. The client RTC API engine 308 communicates with the API coderedirection module 306 through the virtual channel 318 to execute theredirected portion of the real-time media application 310. This virtualchannel 318 provides accelerated graphics.

In particular, the client computing device 304 further includes adisplay composition module 336 to receive the at least one video streamand the positioning geometry of the at least one placeholder, and tooverlay the at least one video stream over the at least one placeholderwithin the displayed RTC window based on the positioning geometry.

The positioning data from the geometry tracking module 332 may beprovided to the display composition module 336 over two different paths.In a first path, the geometry tracking module 332 provides thepositioning geometry to the API code redirection module 306 so as to beincluded in the redirected portion of the real-time media application310 to the client RTC API engine 308. The client RTC API engine 308 thenprovides the positioning data to the display composition module 336. Ina second path, the geometry tracking module 332 provides the positioninggeometry directly to the display composition module 336 over a differentvirtual channel 319. This virtual channel 319 is for non-acceleratedgraphics.

The RTC window as provided by the display 334 is a composited displaythat includes non-accelerated graphics and accelerated graphics.Non-accelerated graphics include UI elements, labels and controlbuttons, for example. Accelerated graphics in the illustrated embodimentis defined by the video stream provided by the local webcam feed 330.The display composition module 336 may receive additional video streams,such as from another end point device, such as client computing device305.

The injected redirection code 314 generates the non-accelerated graphicsbut does not generate the accelerated graphics. This means that thegeometry tracking module 332 analyzes the non-accelerated graphics forthe at least one placeholder. The virtual desktop server 302 alsoincludes a non-accelerated graphics producer 340 that providesnon-accelerated graphics over the virtual channel 319 to anon-accelerated graphics module 342 in the client computing device 304.

Referring now to FIGS. 4-7, an example window monitoring/overlaydetection scenario will be discussed. In this scenario, there are twovideo stream sources. One video stream source is from the local webcamfeed 330 on the first client computing device 304, and the other videostream source is from a second client computing device 305 inpeer-to-peer communications with the first client computing device 304.

When the APIs are intercepted, the two video stream sources areenumerated by the virtual desktop server 302. When a call is started,the client computing device 304 reports to the real-time mediaapplication 310 that there is a first video stream from the local webcamfeed 330. Similarly, the second client computing device 305 reports tothe real-time media application 310 via the real-time media applicationserver 320 that it has a camera providing the second video stream.

The real-time media application 310 gets notification that the two videostreams have arrived, as reflected by events detected within theintercepted APIs. Since the real-time media application 310 does notreceive the actual video streams, it creates a placeholder for eachevent. Each placeholder is drawn where the corresponding video stream isto be placed when displayed on the client computing device 304.

Referring now to FIGS. 4-7, various displays illustrating an examplewindow monitoring/overlay detection scenario with the architectureillustrated in FIG. 3 will be discussed. As shown in window 400, theinjected redirection code 314 in the virtual desktop server 302 rendersa green rectangle 402 on where the peer video from the second clientcomputing device 305 is to be placed and a red rectangle 404 on wherethe picture-in-picture preview video from the local webcam feed 330 isto be placed.

The injected redirection code 314 draws with different colors, with eachcolor assigned to a respective video stream. An ID may also beassociated with each color to identify the respective video streams. Thecontrols 406 overlaid on the window 400 are rendered normally.

Since the window 400 is part of a WebRTC application framework, thereal-time media application 310 needs to know where the video streamsare to be rendered. The geometry tracking module 332 advantageouslydetects the different placeholders within the injected redirection code314, and provides the positioning geometry associated with eachplaceholder to the display composition module 336. The positioninggeometry provides x-y coordinates on where the video streams are to beplaced, along with resolution.

The geometry tracking module 332 detects the different placeholdersbased on color, such as green and red, for example. In otherembodiments, the different placeholders may be detected with patterns orbar codes. In addition, the different colors, patterns and bar codes mayeach have an ID associated therewith that corresponds to a respectivevideo stream. In addition, the placeholder colors may change after beingdetected by the geometry tracking module to a more neutral color thatblends in with the windows that are presented on the client computingdevice 304.

The window 400 is sent to the client computing device 304. The displaycomposition module 336 within the client computing device 304 rendersthe video stream 412 from the second client computing device 305 basedon the specified position geometry associated therewith, as shown inwindow 410 in FIG. 5. The rendered video stream 412 includes a cutout414 for the controls 406 and a cutout 416 for the video stream from thelocal webcam feed 330.

The display composition module 336 within the client computing device304 also renders the video stream 422 from the local webcam feed 330based on the specified position geometry associated therewith, as shownin window 420 in FIG. 6. The rendered video stream 422 does not need anycutouts as with rendered video stream 412.

After compositing by the display composition module 336, the videostreams appear in the correct location with the correct shape. Thewindow 410 in FIG. 7 includes the video stream 412 from the secondclient computing device 305 positioned over the green placeholder 402,the video stream 422 from the local webcam feed 330 positioned over thered placeholder 404, and the controls 406 as provided by the virtualdesktop server 302.

The virtual desktop along with the hosted real-time media application'snon-accelerated content 406 (controls), and other hosted applicationwindows, are drawn on the display 334 of the client computing device 304using graphics sent by the virtual desktop server 302. The screen areasbehind the accelerated content, such as the green rectangle 402 and thered rectangles 404 in this example, are also rendered on the display 334of the client computing device 304 but they are not visible to the userbecause they are overlaid by the accelerated locally rendered content ofthe peer video 412 from the second client computing device 305 and thepicture-in-picture preview video 422 from the local webcam feed 330,respectively.

Referring now to windows 410 and 420 in FIG. 8, the underlyingserver-side window 400 has been moved to a different position. Theinjected redirection code 314 in the virtual desktop server 302 rendersthe placeholders in a new location. In particular, the green rectangle402 is rendered where the peer video from the second client computingdevice 305 is to be placed, and the red rectangle 404 is rendered wherethe picture-in-picture preview video from the local webcam feed 330 isto be placed. The non-accelerated graphics, for example controls 406,are rendered normally in a new location by the non-accelerated graphicsproducer 340.

As a result of the video, the geometry and the non-accelerated graphicsbeing updated asynchronously, whichever is received first is updatedbefore the other. As a result, the video overlays 412, 422 may seemdisconnected from the underling placeholders. This may be viewed as atemporary artifact.

In this example, positioning and the non-accelerated graphics of theserver-side window 400 are updated first. The client computing device304 then receives the updated positioning geometry of the placeholdersfrom the virtual desktop server 302, and then renders the respectivevideo streams 412, 422 with the updated positioning geometry. Aftercompositing, the windows 410 and 420 are in the new location asillustrated in FIG. 9.

Referring now to window 410 in FIG. 10, an overlapping application 430is rendered by the virtual desktop server 302 over window 400 which inturn clips video stream 412 on the client computing device 304. Thoughthe position of the video stream 412 will not change, the shape of thevideo stream 412 will. Consequently, the geometry tracking module 332 inthe virtual desktop server 302 provides positioning geometry updates tothe display composition module 336 in the client computing device 304.

Since the video streams 412 and 422, the geometry and thenon-accelerated graphics 406 are updated asynchronously, the geometrymay be altered to accommodate the overlay window 430 early or late. Inthis example, the video streams 412 and 422, and the non-acceleratedgraphics 406 are updated first, and the bottom part of the applicationis not visible until the geometry update is processed by the clientcomputing device 304.

The client computing device 304 receives the updated positioninggeometry of the placeholders from the virtual desktop server 302, andthen renders the respective video streams 412, 422 with the updatedpositioning geometry while window 430 appears unobstructed. Aftercompositing, the video stream 412 appears in the same location but withthe correct shape, revealing the non-accelerated graphics of the overlaywindow 430, as illustrated in FIG. 11.

Another aspect of WebRTC redirection with window monitoring/overlaydetection is directed to a method for operating a computing system 300comprising at least one video source 330, a virtual desktop server 302and a client computing device 304 comprising a client RTC API engine308, a display 334 and a display composition module 336. The virtualdesktop server 302 comprises a geometry tracking module 332, anapplication framework 312 and an API code redirection module 306. Theapplication framework 312 includes a real-time media application 310 anda native RTC engine 316.

The method includes providing at least one video stream 412 from the atleast one video source 330, and providing real-time communications (RTC)based on operation of the real-time media application 310, with aportion of the real-time media application 310 to be executed by thenative RTC engine 316 when received by the native RTC engine 316.

The method further includes redirecting by the API code redirectionmodule 306 intercepted APIs of the real-time media application 310intended for the native RTC engine based on redirection code 314injected into the real-time media application 310 so that the portion ofthe real-time media application 310 is redirected. The injectedredirection code 314 defines at least one placeholder 402 to indicatepositioning geometry of the at least one video stream 412 within an RTCwindow 410.

The geometry tracking module 332 is operated to detect the at least oneplaceholder 402 within the injected redirection code 314, and to providethe positioning geometry associated therewith. The RTC window isdisplayed on the display 334. The client RTC API engine 308 is operatedto communicate with the API code redirection module 306 through avirtual channel 318 to execute the redirected portion of the real-timemedia application 310.

The display composition module 336 is operated to receive the at leastone video stream 412 and the positioning geometry of the at least oneplaceholder 402, and to overlay the at least one video stream 412 overthe at least one placeholder 402 within the displayed RTC window 410based on the positioning geometry.

Yet another aspect is directed to a non-transitory computer readablemedium for operating a virtual desktop server 302 within a computingsystem 300 as described above. The non-transitory computer readablemedium has a plurality of computer executable instructions for causingthe virtual desktop server 302 to provide real-time communications (RTC)based on operation of the real-time media application 310, with aportion of the real-time media application 310 to be executed by thenative RTC engine 316 when received by the native RTC engine 316.

The steps further include redirecting by the API code redirection module306 intercepted APIs of the real-time media application 310 intended forthe native RTC engine 316 based on redirection code 314 injected intothe real-time media application 310 so that the client RTC API engine308 communicates with the API code redirection module 306 through avirtual channel 318 and executes the redirected portion of the real-timemedia application 310. The injected redirection code 314 defines atleast one placeholder 402 to indicate positioning geometry of the atleast one video stream 412 within an RTC window 410.

The geometry tracking module 332 is operated to detect the at least oneplaceholder 402 within the injected redirection code 314, and to providethe positioning geometry associated therewith so that the clientcomputing device 304 operates the client RTC API engine 308 tocommunicate with the API code redirection module 306 through a virtualchannel 318 to execute the redirected portion of the real-time mediaapplication 310. The display composition module 336 is operated toreceive the at least one video stream 412 and the positioning geometryof the at least one placeholder 402, and to overlay the at least onevideo stream 412 over the at least one placeholder 402 within thedisplayed RTC window 410 based on the positioning geometry.

Geometry tracking includes detection and repainting of semi-transparentoverlays. The technique described above can work for applications thatuse arbitrary opaque UI overlays on top of video elements. To addresssemi-transparent overlays, the same approach can be extended as follows.

Painting of video areas by injected code can be designed in a way thatwould allow robust pattern detection even after color transformation dueto semi-transparent overlays. For example, element ID can be encodedusing pixels with highly distinct colors, while detection code could bedesigned to accept much smaller or shifted differences in pixel colors(due to color blending). Predefined image patterns and informationredundancy techniques such as various checksums used in bar codes can beused to improve detectability of video areas.

Further, painting of video areas can be designed to vary over time,using two or more different colors for each pixel.

Detection code can be extended to derive information aboutsemi-transparent overlay from captured screen pixels. To do this,detection code would compare expected pixel colors with actual capturedpixels. For the simplest implementation with two alternating colors, andassuming a linear blending model at two instances in time:

(pixel color at time 1)=(1−alpha)*(underlay color at time1)+alpha*(overlay color)  1)

(pixel color at time 2)=(1−alpha)*(underlay color at time2)+alpha*(overlay color)  2)

Both alpha and overlay color can be recovered with acceptable loss ofprecision:

alpha=1−(pixel color at time 2−pixel color at time 1)/(underlay color attime 2−underlay color at time 1)

overlay color=(pixel color−(1−alpha)*underlay color)/alpha

FIG. 13 is an illustrative table diagram 500 for the method of detectingsemi-transparent overlays described above. The input column 510specifies different combinations of overlay colors described in terms ofred (R), green (G) and blue (B) pixel color values and opacity, or alphavalue. The blended column 520 specifies two different colors, a blackblend 522 and a white blend 524 in this example, that can be used by theinjected code at two different times, e.g., time 1 and time 2, asdiscussed above.

The captured/recovered column 530 specifies the respective computed,values for the alpha and pixel colors, which are recovered by thegraphics capture and remoting code. For example, when alpha value iszero (0), the overlay is completely invisible. In this particular casethe overlay colors cannot be detected due to divide-by-zero error, asillustrated by zeroes in the detected color pixels. However, this is noteven necessary because with opacity of zero (0), the overlay is notvisible anyway. In another example, and at the other extreme case ofalpha value of one (1), the overlay completely obscures the blendingcolors.

FIG. 14 is a sample color bars image 540 used in a test run of themethod of detecting semi-transparent overlays described above.

FIG. 15 is an illustrative image comparison diagram for a test run ofthe method of detecting semi-transparent overlays described above. Inparticular, FIG. 15 provides a visual illustration of a test run of themethod described above on the sample image of FIG. 14 containing colorbars with different colors and opacities.

The image on the top left 550 is the original (before) image, while theimage on the top right 552 is the computed or detected (after) image.There is no perceptible difference between the two images. However, atextreme values of opacity, for example, when the alpha value is close tozero (0) or close to one (1), due to pixel color value roundinginaccuracies, the before and after images may start to differ slightly.This is illustrated in the bottom image 554, which renders a grayscaleversion of the detected color bar image. For strictly illustrativepurposes the following is provided.

Pixels that have the same color values in both of the original (before)image and the detected (after) image are rendered in a grayscalerepresentation of that shared color value.

Pixels that have differing color values in the original (before) imageand the detected (after) image, where the difference is below a presetthreshold, are rendered in a blue-scale representation of the detectedcolor value.

Pixels that have differing color values in the original (before) imageand the detected (after) image, where the difference is above a presetthreshold, are rendered in a red-scale representation of the detectedcolor value.

In this example, the threshold has been defined as 5 unit's differenceout of 255 unit's total, or approximately 2 percent difference.

FIG. 16 is an illustrative image 560 of a step in the method ofdetecting semi-transparent overlays described above. In particular, FIG.16 illustrates the image 560 observed by the detection code at time one(1) after applying a black blend in combination with the color barsimage of FIG. 14.

FIG. 17 is another illustrative image 570 of another step in the methodof detecting semi-transparent overlays described above. In particular,FIG. 17 illustrates the image 570 observed by the detection code at timetwo (2) after applying a white blend in combination with the color barsimage of FIG. 14. More alternating colors may be used to improveaccuracy and address corner cases.

As will be discussed in further detail below in reference to FIG. 18,accuracy of this process can be improved by providing a feedback channelfrom the detection code to the injected code. Using this feedbackchannel, detection code would be able to request video area paintingusing specific, or adaptive, colors or patterns, to improve robustnessand accuracy of detection process.

Spatial filtering techniques can be used to improve this process aswell. For example, it is likely that the same alpha value will be usedfor large adjacent areas of semi-transparent overlays. Taking this intoaccount, a filter can be used to average recovered per-pixel alphavalues and accept the more accurate filtered value for furthercalculations.

Information about semi-transparent overlays, including alpha and pixelcolor values, can be transmitted from the server 302′ to the client 304′and rendered on top of client-local video, resulting in an accuratereproduction of application UI.

In the instrumentation of the server-side HTML rendering engine, the twotechniques above make it possible to detect video area geometry withoutinstrumenting the HTML rendering engine. Direct instrumentation of therendering engine provides another way of achieving the same purpose. Forthis technique, the HTML rendering engine in the browser or applicationframework 312′ can be hooked or partially replaced so that informationabout video element positioning and overlays can be retrieved directly.

As yet another approach, a customized Chromium-based browser engine canbe used to instrument the HTML rendering. For example, as part of theCitrix Secure Browser Cloud Service.

As discussed above, the architecture 300 illustrated in FIG. 3 supportsdetection and repainting of semi-transparent overlays 406 as directed towebRTC API redirection. In other embodiments, the architecture 300 maybe modified to support any accelerated graphics media that includes asemi-transparent overlay 406. Such an architecture 300′ is provided inFIG. 18.

In the illustrated architecture 300′, the application framework 312′ nowincludes a media application 311′ instead of the real-time mediaapplication 310, an accelerated content redirection module 315′ insteadof the injected redirection code module 314 and the native RTC engine316, and a host-side virtual channel redirection module 307′ instead ofthe RTC API code redirection module 306. On the client computing device304′ the RTC API engine 308 is replaced with a client-side virtualchannel redirection module 309′ that communicates with the host-sidevirtual channel redirection module 307′.

The accelerated content redirection module 315′ redirects the portion ofthe media streaming based on at least one of the following: DirectShowfilter, DirectX Media Object (DMO) filter, Media Foundation filter,HTML5 video redirection module, Flash video redirection module, BrowserHelper Object (BHO), and browser extension. DirectShow filter, DirectXMedia Object (DMO) filter, and Media Foundation filter are used byCitrix RAVE (Remoting Audio and Video Extensions) technology. HTML5video redirection module is used by Citrix HTML5 video redirectiontechnology. Flash video redirection module is used by Citrix Flash videoredirection technology.

For the media application 311′ to play a file, various factors are takeninto account, such as source of the file, file format, and media formatinside the file. Based on these factors, one or more filters may beregistered. The filters include source filters, transform filters, andrendering filters that allow the decompression and rendering of the fileto be redirected to the client computing device 304′.

The host-side filters proxy the still compressed video and audio datafrom the virtual desktop server 302′ to the client computing device304′. At the client computing device 304′, one or more client-sidenative filters are loaded to decompress the video and audio data, renderthe video and play the audio. Control information which includes windowpositioning information and additional stream control information isalso provided by the one or more host-side filters.

Still referring to FIG. 18 and architecture 300′, the acceleratedcontent redirection module 315′ generates the non-accelerated graphicsbut does not generate the accelerated graphics. This means that thegeometry tracking module 332′ analyzes the non-accelerated graphics forthe at least one placeholder. The virtual desktop server 302′ alsoincludes a non-accelerated graphics producer 340′ that providesnon-accelerated graphics over the virtual channel 319′ to anon-accelerated graphics module 342′ in the client computing device304′.

The architecture 300′ includes at least one video source 305′ to provideat least one video stream 313′. The video source 305′ may be referred toas an accelerated content media source. The virtual desktop server 302′includes the application framework 312′ that includes the mediaapplication 311 to provide media streaming. The media stream includesthe at least one video stream 313′ with at least one overlay 406 to bepositioned on the at least one video stream 313′. The acceleratedcontent redirection module 315′ is to redirect a portion of the mediastreaming by providing a placeholder 402 to indicate positioninggeometry of the at least one video stream 313′ within a media window334′. The placeholder 402 is to include the overlay 406.

Providing the placeholder 402 includes providing a first color 522 foran underlay of the placeholder 402 at a first time, and providing asecond color 524 for the underlay of the placeholder 402 at a secondtime.

The geometry tracking module 332′ is to detect the placeholder 402 anddetermine positioning geometry associated therewith, and determine acolor and an alpha blending factor of the overlay 406 based oncalculations involving the first color 522 for the underlay of theplaceholder 402 at the first time, and the second color 524 for theunderlay of the placeholder 402 at the second time. The calculations areas described above using equations one (1) and two (2).

The determined color and the alpha blending factor of the overlay 406are illustratively provided in the captured/recovered column 530 in FIG.13. Comp. A is the alpha blending factor. Each of the red (R), green (G)and blue (B) pixel color values are represented by Comp. R, Comp. G, andComp. B.

The client computing device 304′ includes a display to display the mediawindow 334′. The virtual channel redirection module 309′ on the clientside communicates with the accelerated content redirection module 315′through a virtual channel 318′ to execute the redirected portion of themedia application.

The display composition module 336′ is to receive the video stream 313′,the positioning geometry of the placeholder 402, and the color and thealpha blending factor for each pixel of the overlay 406 so as to overlaythe video stream 313′ over the placeholder 402 within the displayedwindow 334′ based on the positioning geometry, and to overlay theoverlay 406 in the color and alpha blending factor associated therewith.

As discussed above in one example, the API code redirection module 306in the virtual desktop server 302 rendered a green rectangle 402 (as aplaceholder) on where the peer video from the second client computingdevice 305 is to be placed. Similarly, in the context of thearchitecture 300′ illustrated in FIG. 18, the host-side redirectionmodule 307′ in the virtual desktop server 302′ may render a greenrectangle 402 (as a placeholder) on where the peer video from the secondclient computing device 305′ is to be placed. Since the overlay 406positioned over the green rectangle 402 had an opacity of zero (0),there was no need to determine an alpha blending factor and a color ofthe overlay.

For a semi-transparent overlay 406 two (2) or more blended colors willbe generated instead of a single color. Each pixel color value in theplaceholder 402 (which includes the overlay color) is determined by thegeometry tracking module 332′.

For the architecture 300′ illustrated in FIG. 18, the acceleratedcontent redirection module 315′ generates the placeholder 402 with anunderlay color 522 at time one (1), and then generates the placeholder402 with an underlay color 524 at time two (2). The accelerated contentredirection module 315′ tells the geometry tracking module 332′ theunderlay colors used at time one (1) and two (2). The geometry trackingmodule 332′ uses Equations (1) and (2) as discussed above to calculatethe alpha blending factor and the color for each pixel of the overlay406. Since there are two equations and two unknowns, the two unknowns(i.e., alpha blending factor and overlay color) may be determined.

In some cases, the black and white underlay colors may be too close tothe colors of the overlay 406. To improve color contrast between theunderlay colors and the overlay color, the geometry tracking module 332′provides feedback to the accelerated content redirection module 315′ tovary the first and second underlay colors. For example, yellow and greenmay be used to provide a better color contrast instead of black andwhite.

The displayed media window 334′ includes a composited display ofnon-accelerated graphics and accelerated graphics, with the acceleratedgraphics defined by the video stream 313′. The redirected portion of themedia streaming only generates the non-accelerated graphics, and thegeometry tracking module 332′ analyzes the non-accelerated graphics forthe placeholder 402 and the overlay 406.

The video source may be a camera 330 coupled to the client computingdevice 304 as illustrated in FIG. 3. Alternatively or in addition to,the video source may be a camera coupled to a different client computingdevice 305′ in peer-to-peer communications with the client computingdevice 304′.

The video source is an accelerated content media source. The acceleratedcontent media source is at least one of the following: video streamingwebsite, video Content Delivery Network (CDN), video file share, DVD.

The video source may include a shared display surface coupled to adifferent client computing device 305′ in peer-to-peer communicationswith the client computing device 304′. This covers screen sharing wherea shared display surface may be overlaid with a semi-transparent overlay406.

Another aspect of detection and repainting of semi-transparent overlays406 is directed to a method for operating a computing system 300comprising at least one video source 305′, and a virtual desktop server302′, with the virtual desktop server 302′ comprising a geometrytracking module 332′, an application framework 312′ and an acceleratedcontent redirection module 315′. The application framework 312′ includesa media application 311′. The method includes providing at least onevideo stream 313′ from the at least one video source 305′, and providingmedia streaming based on operation of the media application, with themedia streaming including the at least one video stream 313′ and atleast one overlay 406 on the at least one video stream 313′.

A portion of the media streaming is redirected by providing aplaceholder 402 to indicate positioning geometry of the at least onevideo stream 313′ within a media window 334′, with the placeholder 402to include the at least one overlay 406.

Providing the placeholder 402 includes providing a first color 522 foran underlay of the placeholder 402 at a first time, and providing asecond color 524 for the underlay of the placeholder 402 at a secondtime.

The method further includes operating the geometry tracking module 332′to detect the placeholder 402 and determine positioning geometryassociated therewith, and determine a color and an alpha blending factorof the at least one overlay 406 based on calculations involving thefirst color 522 for the underlay of the placeholder 402 at the firsttime, and the second color 524 for the underlay of the placeholder 402at the second time.

Yet another aspect is directed to a non-transitory computer readablemedium for operating a virtual desktop server 302′ within a computingsystem 300′ comprising at least one video source 305′, with the virtualdesktop server 302′ comprising a geometry tracking module 332′, anapplication framework 312′ and an accelerated content redirection module315′. The application framework 312′ includes a media application 311′.

The non-transitory computer readable medium has a plurality of computerexecutable instructions for causing the virtual desktop server 302′ toprovide media streaming based on operation of the media application311′, with the media streaming including the at least one video stream313′ and at least one overlay 406 on the at least one video stream 313′.

A portion of the media streaming is redirected by providing aplaceholder 402 to indicate positioning geometry of the at least onevideo stream 313′ within a media window 334′, with the placeholder 402to include the at least one overlay 406.

Providing the placeholder 402 includes providing a first color 522 foran underlay of the placeholder 402 at a first time, and providing asecond color 524 for the underlay of the placeholder 402 at a secondtime.

The geometry tracking module 332′ is operated to detect the placeholder402 and determine positioning geometry associated therewith, anddetermine a color and an alpha blending factor of the at least oneoverlay 406 based on calculations involving the first color 522 for theunderlay of the placeholder 402 at the first time, and the second color524 for the underlay of the placeholder 402 at the second time.

Referring now to FIGS. 3 and 12, the illustrated computing system 300will be discussed in terms screen sharing functionality to achieveseamless redirection of WebRTC functionality. WebRTC includes APIs(getDisplayMedia) and other related API elements, defined in[screen-capture], that allow applications to share the visual contentsof the local browser window, a single window of a different application,all windows of a specific application, a single monitor, or a collectionof monitors including the whole desktop.

Screen sharing under desktop virtualization presents a particularchallenge due to a complexity of how the complete user-visible desktopis composed from parts running on one or more virtual desktop servers aswell as on the local desktop. Application or framework code running onany particular physical or virtual computer may be able to enumerate allsources of shareable screen content that the user may be interested in,or may not have access to pixels of a particular window or monitor.WebRTC redirection framework can be designed to deal with thiscomplexity while providing optimized user experience for screen sharing.

Citrix patent application ID1167US, filed on Jan. 26, 2018 as U.S.patent application Ser. No. 15/880,938, “Virtual Computing SystemProviding Local Screen Sharing from Hosted Collaboration Applicationsand Related Methods” is incorporated by reference herein in itsentirety. The methods discussed in ID1167US fully apply to WebRTCredirection. The present disclosure offers additional incrementalenhancements discussed below: 1) distributed enumeration of sharablecontent sources, and 2) optimizations of content sharing media andnetwork pipeline.

In the distributed enumeration of shareable content sources, elements ofWebRTC redirection framework (connector, engine, and possibly virtualdesktop server and client code) can be designed to enumerate possiblesources of content sharing (applications and their windows, monitors anddesktops) in parallel on virtual desktop servers 302 and clientcomputing devices 304, 305. Information internal to the desktopvirtualization system may be used to create correct descriptions ofthese sources (e.g., correctly associate windows with correspondingapplications). Inter-component protocols may be used to consolidate thisinformation into a single list, and present the resulting list to theuser when the application calls getDisplayMedia( ).

In the optimizations of content sharing media and network pipelines,when a particular screen sharing source is selected by the user, WebRTCredirection code can select the optimal location for capturing thecontent of that source. For example, if the user chooses a virtualapplication window, contents of that window should be captured on thevirtual desktop server 302 because the window may be obscured on theclient computing device 304. Alternatively, if the whole client desktopis selected for sharing, pixels of the desktop should be captured on theclient computing device 304, since the graphics have already beendelivered to the client computing device anyway and to avoid additionalload on the virtual desktop server 302.

A further optimization may combine the screen rendering pipeline in thevirtual desktop client application with the WebRTC redirection capturepipeline for screen content sharing.

In addition to choosing the optimal location for capturing shareablescreen content, WebRTC redirection code can select the optimal locationand method for compressing this content using a suitable video codec,and a network endpoint for transmitting this content to a remotedestination. For example, screen content captured on the virtual desktopserver 302 may be suitably compressed on the virtual desktop server 302,streamed from there to the client computing device 304, and transmittedto the network from the client computing device 304.

Alternatively, the same screen content may be only mildly compressed onthe virtual desktop server 302, and achieve final compression on theclient computing device 304. Alternatively, the same screen content maybe compressed and transmitted from the virtual desktop server 302, notinvolving the client computing device 304 at all. These choices presentdifferent server and network scalability and network connectivitytradeoffs, and may be chosen based on policies or other criteria.

As illustrated in FIG. 12, the computing system 300 advantageouslyprovides for sharing of both local and virtual client surfaces 331, 335on the first client computing device 304 with the second clientcomputing device 305. The injected redirection code 314 is used toenumerate shared surfaces from the client computing device 304 (localclient surface 331) and from the virtual desktop server 302 (virtualdesktop session 355) and combine them together into a single list. Thevirtual desktop server 302 includes a monitor 353 to generate thevirtual desktop session 355.

One or more elements of the virtual desktop session 355 are rendered atthe first client computing device 304 as a virtual client surface 335 ona first monitor 333 illustratively including a virtual session userinterface (UI) 337. However, the first client computing device 304 alsogenerates its own local client graphics surface 331, here on a secondmonitor 329. The local graphics surface 331 may include applications(web browser, document processing applications, etc.) installed locallyat the client computing device 304.

It should be noted that both the local and virtual client surfaces 331,335 may be displayed on a same monitor in different embodiments, i.e.,they need not be on multiple monitors in all embodiments. As notedabove, with the real-time media application 310 there is currently noway for the user of the first client computing device 304 to share thelocal graphics surface 331.

Yet, once the real-time media application 310 is launched, the virtualdesktop server 302 uses the injected redirection code 314 to enumerateshared surfaces from the client computing device 304 (local clientsurface 331) and from the virtual desktop server 302 (virtual clientsurface 335) and combine them together into a single list that ispresented to the user of the first client computing device 304.

This is accomplished without the need for virtual web cams and virtualplug-and-play (PnP) monitors at the virtual desktop server 302 as isneeded in the above referenced Citrix patent application ID1167US. Inthe Citrix patent application ID1167US, the client surfaces are beingenumerated in the virtual desktop server environment. Here, theillustrated computing system 300 is doing the reverse. The computingsystem 300 enumerates the client surfaces (local and/or virtual) andprojects them to the first client computing device 304 so they can bemore efficiently sent peer-to-peer to the second client computing device305.

The second client computing device 305 generates a virtual client sharedsurface 365 on a first monitor 363. The second client computing device305 also generates its own local client graphics shared surface 361,here on a second monitor 359.

A single list of enumerated surfaces is provided by the real-time mediaapplication 310. The user of the first client computing device 304 mayclick on a button or prompt to share surfaces (e.g., windows, monitorsor desktops) and this triggers enumeration of those surfaces. Since thegetDisplayMedia API element is intercepted, the enumerated local andvirtual client surfaces 331, 335 can be combined.

More particularly, the illustrated computing system 300 includes thefirst client computing device 304 to display a local client surface 331and a virtual client surface 335, with the local client surface 331 andthe virtual client surface 335 to be shared with a second clientcomputing device 305 having peer-to-peer communications with the firstclient computing device 304.

The virtual desktop server 302 communicates with the first clientcomputing device 304 through a virtual channel 318 to provide thevirtual client surface 335, and includes an application framework 312that includes a real-time media application 310 to provide real-timecommunications (RTC), and a native RTC engine 316 to execute a portionof the real-time media application 310 when received by the native RTCengine 316.

An API code redirection module 306 within the virtual desktop server 302redirects intercepted APIs of the real-time media application 310intended for the native RTC engine 316 based on redirection code 314injected into the real-time media application 310 so that the portion ofthe real-time media application 310 is redirected, with the injectedredirection code 314 enumerating the local and virtual client surfaces331, 335.

The first client computing device 304 includes a client RTC API engine308 communicating with the API code redirection module 306 through thevirtual channel 318 to execute the redirected portion of the real-timemedia application 310, and to share the local and virtual clientsurfaces 331, 335 with the second client computing device 305 based onthe intercepted APIs enumerating the local and virtual client surfaces331, 335.

As noted above, there may be an optimal location for capturing sourcecontent. For example, the virtual client surface 335 may includeoverlapping windows. If one of the overlapping windows is selected to beshared with the second client computing device 305, then pixels of theselected window are obtained from the virtual desktop server 302. Asanother example, a whole virtual desktop session 355 of the virtualdesktop server 302 is to be shared. In this case pixels of the virtualdesktop session 355 are captured on the first client computing device304 to be delivered to the second client computing device 305.

As also noted above, a screen rendering pipeline and an RTC redirectioncapture pipeline may be combined. For example, the virtual desktopsession 355 may include at least one window that is to be shared withthe second client computing device 305. Then pixels of the shared windoware to be provided by the virtual desktop server 302 to the secondclient computing device 305.

In terms of compression, the optimal location for compressing shareablescreen content can be selected. For example, the virtual desktop server302 may compress the pixels of the at least one window. If the window isto be shared with the second client computing device 305, then thecompressed pixels of the shared window are sent to the first clientcomputing device 304 for sharing with the second client computing device305.

Another aspect of WebRTC redirection with screen sharing is directed toa method for operating a computing system 300 comprising a virtualdesktop server 302 and a first client computing device 304 comprising aclient RTC API engine 308, as discussed above. The method includesoperating the first client computing device 304 to display a localclient surface 331 and a virtual client surface 335, with the localclient surface 331 and the virtual client surface 335 to be shared witha second client computing device 305 having peer-to-peer communicationswith the first client computing device 304.

The virtual desktop server 302 is operated to communicate with the firstclient computing device 304 through a virtual channel 318 to provide thevirtual client surface 335. Real-time communications (RTC) is providedbased on operation of the real-time media application 310, with aportion of the real-time media application 310 to be executed by thenative RTC engine 316 when received by the native RTC engine 316.

The API code redirection module 306 redirects intercepted APIs of thereal-time media application 310 intended for the native RTC engine 316based on redirection code 314 injected into the real-time mediaapplication 310 so that the portion of the real-time media application310 is redirected, with the injected redirection code 314 enumeratingthe local and virtual client surfaces 331, 335.

The client RTC API engine 308 is operated to communicate with the APIcode redirection module 306 through the virtual channel 318 to executethe redirected portion of the real-time media application 310. Theclient RTC API engine 308 is further operated to share the local andvirtual client surfaces 331, 335 with the second client computing device305 based on the intercepted APIs enumerating the local and virtualclient surfaces 331, 335.

Yet another aspect is directed to a non-transitory computer readablemedium for operating a virtual desktop server 302 within a computingsystem 300 as described above. The non-transitory computer readablemedium has a plurality of computer executable instructions for causingthe virtual desktop server 302 to communicate with the first clientcomputing device 304 through a virtual channel 318 to provide thevirtual client surface 335, and provide real-time communications (RTC)based on operation of the real-time media application 310. A portion ofthe real-time media application 310 is to be executed by the native RTCengine 316 when received by the native RTC engine 316.

The API code redirection module 306 intercepts APIs of the real-timemedia application 310 intended for the native RTC engine 316 based onredirection code 314 injected into the real-time media application 310so that the client RTC API engine 308 communicates with the API coderedirection module 306 through a virtual channel 318 to execute t

he redirected portion of the real-time media application 310. Theinjected redirection code 314 enumerates the local and virtual clientsurfaces 331, 335 so that the first client computing device 304 sharesthe local and virtual client surfaces 331, 335 with the second clientcomputing device 305 based on the intercepted APIs enumerating the localand virtual client surfaces 331, 335.

In thin client resource management, WebRTC may be active in more thanone browser tab, such as for video rendering, for example. A browser maydecide to suspend video playback in an inactive tab. Presumably, thiswill be reflected onto the MediaStream object connected to the HTML5video element in the inactive tab of the hosted app. The real-time mediaapplication 310 may be active in a plurality of browser tabs, and theclient computing device 304 suspends video playback in an inactivebrowser tab and/or stops rendering in a non-visible area.

In addition, independent of the actions of the inactive browser tab ofthe hosted app, a receiver may decide to automatically stop the WebRTCrendering in a non-visible area. This may be done conditionally, e.g.,on a thin client device, which may be resource challenged, or inconditions of limited bandwidth, which may improve UX in other activetabs and WebRTC channels.

Security policies will now be discussed. Real time media support inbrowser applications involves a very large number of security andprivacy considerations. An incomplete list of examples of suchconsiderations includes the possibility of breaching users' privacy bygaining unauthorized access to microphones and video cameras in users'workspaces or homes; security leaks due to unauthorized content sharing;and the possibility of undesired fingerprinting of users or theirendpoints through enumeration of connected devices. For example, thevirtual desktop server 302 includes at least one security policy, andexecution by the client RTC API engine 308 of at least part of theredirected portion of the real-time media application is based on the atleast one security policy. WebRTC redirection needs to address theseconcerns, and may also implement a number of additional policy andmonitoring features in the area of security and privacy, including thefollowing.

Enabling administrators to define “automatic allow”, “automatic deny”,or “ask user” policies for WebRTC redirection in general and forspecific subsets of WebRTC functionality (e.g., access to microphones,cameras, speakers, or screen content, as well as all the same featuresin the fallback scenario.).

Allowing user identity, membership in a security group, or other userattributes, to be used as input to a WebRTC related policy.

Allowing application identity to be used as input to a WebRTC relatedpolicy. For example, the application virtualization framework mayautomatically detect a particular SaaS application, and apply policiesspecific to that application.

Allowing endpoint location (physical or network) to be used as input toa WebRTC related policy. For example, for endpoints in a secure locationthe framework may automatically disallow video and content sharing,allowing only audio sessions.

Network connectivity steering, ICE extensions and SDP rewriting will nowbe discussed. A large portion of WebRTC functionality lies in enablingpeer to peer network connectivity for real-time media. The followingbriefly identifies the technologies used for this:

WebRTC implements the ICE (Interactive Connectivity Establishment)procedure to identify all possible connectivity options between two realtime media endpoints.

As part of ICE procedure, WebRTC collects all connectivitycandidates-local network endpoints (transport/IP address/port tuples)available for communications.

WebRTC can work with one or more connectivity servers (alternativelyknown as media relay servers, STUN servers, TURN servers, or ICEservers)—network servers that facilitate connectivity by allowingendpoints to probe the network for existence of NAT (using the STUNprotocol), and to create media relay points on the servers and use theseports as alternative connectivity candidates (using the TURN protocol).

WebRTC uses the SDP protocol (Session Description Protocol) to encodeand exchange network connectivity details. SDP messages (sessiondescription) contain full descriptions of media sessions, includinginformation about connectivity candidates.

Lack of network connectivity or impaired network connectivity are verytypical concerns for desktop virtualization deployments. To addressthese, the WebRTC redirection framework can use the following noveltechniques: 1) tunneled server-side transport fallback, and 2) changingthe set of ICE servers.

In the tunneled server-side transport fallback, ideally, endpointsshould be able to exchange media streams directly over UDP, and if thatis not possible, use TURN servers to relay the media packets. If neitherof these options is available, real-time connectivity would not bepossible.

WebRTC redirection has components running on the virtual desktop serverand on the client, providing an additional connectivity option. Namely,it is possible to tunnel the stream of media packets between the clientand the server through a dedicated or shared virtual channel, and use aport or a set of ports on the server as the network endpoint. Thistransport option can be very useful in many scenarios, for example whenneither direct connectivity nor relay servers are available.

To implement this option, the WebRTC redirection framework must a)implement the functionality to open a server-side UDP port from theconnector on demand, and relay media packets between it and theclient-side engine through a virtual channel, b) use the server-side IPaddress and port as an additional candidate for the ICE process. ICErequires this to be repeated for all media streams where additionalconnectivity is necessary.

In changing the set of ICE servers, a WebRTC application typicallyreceives the set of ICE servers from an application specificsource—e.g., the server-side portion of the application. The WebRTCredirection framework can extend, change, or replace theapplication-defined set of ICE servers with a framework specific set ofone or more servers, to implement various types of traffic steeringfunctionality.

For example, a multipurpose gateway or branch appliance integrated withthe desktop virtualization framework may serve as an additional ICE(media relay) server. The WebRTC redirection framework may make thisserver automatically available for media traffic managed by virtualizedWebRTC application. Alternatively, the WebRTC framework may replace theset of ICE servers that the application intends to use with a differentset. This may be determined using network connectivity probing, dynamicDNS, or other similar techniques, to improve media quality by optimalmedia stream routing.

In WebRTC activity and quality monitoring, WebRTC redirection frameworkhas complete visibility into real-time media activity and can implementvarious types of activity and quality monitoring. For example, real-timemedia monitoring statistics can be combined with other resource usageand quality metrics produced by the desktop virtualization framework,and used to present a more comprehensive view to systems andapplications administrators and other decision makers.

In a virtual app/desktop session collaboration, a shared HDX session usecase will be discussed. During HDX virtual session sharing orcollaboration there will be an initiator and any number ofcollaborators. The HDX session will always be owned by the initiator.The initiator invites the collaborators to join or share the session.All collaborators will have separate protocol stacks at Receiver.

At the Virtual Desktop server all collaborators could share the protocolstack. The management of the collaboration session, including policies,invitation, authentication, security, input arbitration, and other coremechanisms related to the shared HDX session lifetime are outside thescope of this disclosure.

The server connector code could aggregate devices from all endpoints.For example, Webcams can be enumerated from the initiator and allcollaborators and presented to the get user media WebRTC API(NavigatorUserMedia, getUserMedia( )) in the context of the app.Thereafter, all the info (Webcam names) will be sent to the initiatorand the collaborators so Receivers can implement acceleratedPeer-to-Peer (P2P) overlays. Each client endpoint should filter outtheir own Webcam.

In case any one of the initiator or the collaborators does not supportthe accelerated WebRTC functionality, the virtual desktop serverconnector code could operate in “dual” mode, i.e., remote WebRTC wherepossible, and fallback to host-side rendering for purposes of remotingto WebRTC-redirection incapable client endpoints.

Upon fallback, injected code will defer to the built-in WebRTC engine toenumerate local devices, which may in turn invoke other virtual channelfunctionality to enumerate client devices and perform non-optimizedredirection, for example via generic Audio redirection or graphicsremoting virtual channels. The support of non-optimized redirection inshared sessions is VC specific and outside the scope of this disclosure.An alternative approach would be to disable WebRTC remoting for allcollaborators, but this is more limiting.

In the event the initiator or a collaborator disconnects from the sharedsession, either on purpose or accidentally, e.g., as a result of networkdisruption, disconnect events will be raised to the server connectorcode. This in turn will notify the hosted app via the WebRTC API thatmedia devices from the disconnected endpoint are no longer available.Thereafter, the event will be sent to the other client endpoints(remaining initiator or collaborators) so receivers can update the listof accelerated Peer-to-Peer (P2P) overlays.

Functional background may be provided in the following references, allof which are assigned to the current assignee of the present applicationand which are all incorporated by reference in their entirety:

Remoting Audio and Video Extensions (RAVE); Methods and Apparatus forGenerating Graphical and Media Displays at a Client: U.S. Pat. Nos.8,131,816; 8,671,213; and 9,325,759.

Reverse RAVE (Webcam Redirection); Systems and Methods for RemotelyPresenting a Multimedia Stream: U.S. Pat. Nos. 9,191,425; and 9,203,883.

Flash Redirection; Systems and methods for remoting multimedia plugincalls: U.S. Pat. No. 8,296,357.

HTML5 Video Redirection; Multimedia redirection in a virtualizedenvironment using a proxy server: U.S. Pat. Nos. 9,124,668; and9,571,599.

Browser Content Redirection; Redirection of Web Content:Provisional—ID1340 (B&W ref 007737.00826); Managing Browser SessionNavigation Between One or More Browsers: Provisional—ID1368US (B&W ref007737.00827).

Several patents that cover Citrix HDX Real-time Optimization Packcomponent architecture include: U.S. Pat. Nos. 8,949,316; 8,869,141;8,799,362; and 8,601,056, sharing the title “Scalable high-performanceinteractive real-time media architectures for virtual desktopenvironments”.

However, as explained in detail above, the novelty of this disclosurelies in specific functions and interactions of the injected code,connector, and engine modules that are designed to optimize real timemedia APIs and WebRTC in particular.

Many modifications and other embodiments will come to the mind of oneskilled in the art having the benefit of the teachings presented in theforegoing descriptions and the associated drawings. Therefore, it isunderstood that the disclosure is not to be limited to the specificembodiments disclosed, and that modifications and embodiments areintended to be included within the scope of this disclosure.

That which is claimed:
 1. A server comprising: at least one processorconfigured to perform the following: execute a media application toprovide media streaming that includes at least one video stream and atleast one overlay on the at least one video stream; redirect a portionof the media streaming by providing a placeholder to indicatepositioning geometry of the at least one video stream within a mediawindow, with the placeholder to include the at least one overlay; detectthe placeholder and determine positioning geometry associated therewith;and determine a color and an alpha blending factor of the at least oneoverlay based on calculations involving different colors of the at leastone underlay at different times.
 2. The server according to claim 1wherein said processor is configured to provide the placeholder based onthe following: provide a first color for an underlay of the placeholderat a first time; and provide a second color for the underlay of theplaceholder at a second time.
 3. The server according to claim 2 whereinsaid processor is configured to determine the color and the alphablending factor of the at least one overlay based on calculationsinvolving the first color for the underlay of the placeholder at thefirst time, and the second color for the underlay of the placeholder atthe second time.
 4. The server according to claim 1 wherein saidprocessor is further configured to provide the at least one videostream, the positioning geometry of the at least one placeholder, andthe color and the alpha blending factor of the at least one overlay to aclient device for the client device to overlay the at least one videostream over the at least one placeholder within a displayed media windowbased on the positioning geometry, and to overlay the at least oneoverlay in the color and alpha blending factor associated therewith. 5.The server according to claim 1 wherein the color and the alpha blendingfactor for the at least one overlay is determined for each pixel in theplaceholder.
 6. The server according to claim 1 wherein the color andthe alpha blending factor for the at least one overlay is determinedbased on the following equations:(pixel color at time 1)=(1−alpha)*(underlay color at time1)+alpha*(overlay color)(pixel color at time 2)=(1−alpha)*(underlay color at time2)+alpha*(overlay color) where alpha=1−(pixel color at time 2−pixelcolor at time 1)/(underlay color at time 2−underlay color at time 1);where overlay color=(pixel color−(1−alpha)*underlay color)/alpha; wherepixel color corresponds to a blended color of the underlay color and theat least one overlay color at time 1 or at time 2; wherein alphacorresponds to the alpha blending factor; and wherein the overlay colorcorresponds to the color of the at least one overlay.
 7. The serveraccording to claim 6 wherein said processor is further configured tovary the first and second colors to improve color contrast between theunderlay color and the at least one overlay color.
 8. The serveraccording to claim 1 wherein the media application comprises a real-timemedia application providing real-time communications (RTC), and whereinsaid processor is further configured to redirect the portion of thereal-time media communications based on injected JavaScript code forWebRTC API redirection.
 9. The server according to claim 1 wherein saidprocessor is configured to redirect the portion of the media streamingbased on at least one of the following: DirectShow filter, DirectX MediaObject (DMO) filter, Media Foundation filter, HTML5 video redirectionmodule, Flash video redirection module, Browser Helper Object (BHO),browser extension.
 10. The computing system according to claim 1 whereinsaid processor is further configured to perform the following: generatenon-accelerated graphics for the redirected portion of the mediastreaming; and analyze the non-accelerated graphics for the at least oneplaceholder and the at least one overlay.
 11. A method comprising:executing a media application to provide media streaming that includesat least one video stream and at least one overlay on the at least onevideo stream; redirecting a portion of the media streaming by providinga placeholder to indicate positioning geometry of the at least one videostream within a media window, with the placeholder to include the atleast one overlay; detecting the placeholder and determine positioninggeometry associated therewith; and determining a color and an alphablending factor of the at least one overlay based on calculationsinvolving different colors of the at least one underlay at differenttimes.
 12. The method according to claim 11 wherein providing theplaceholder comprises: providing a first color for an underlay of theplaceholder at a first time; and providing a second color for theunderlay of the placeholder at a second time.
 13. The method accordingto claim 12 wherein the calculations involving different colors of theat least one underlay at different times involve the first color for theunderlay of the placeholder at the first time, and the second color forthe underlay of the placeholder at the second time.
 14. The methodaccording to claim 11 further comprising providing the at least onevideo stream, the positioning geometry of the at least one placeholder,and the color and the alpha blending factor of the at least one overlayto a client device for the client device to overlay the at least onevideo stream over the at least one placeholder within a displayed mediawindow based on the positioning geometry, and to overlay the at leastone overlay in the color and alpha blending factor associated therewith.15. The method according to claim 11 wherein the color and the alphablending factor for the at least one overlay is determined for eachpixel in the placeholder.
 16. The method according to claim 11 whereinthe color and the alpha blending factor for the at least one overlay isdetermined based on the following equations:(pixel color at time 1)=(1−alpha)*(underlay color at time1)+alpha*(overlay color)(pixel color at time 2)=(1−alpha)*(underlay color at time2)+alpha*(overlay color) where alpha=1−(pixel color at time 2−pixelcolor at time 1)/(underlay color at time 2−underlay color at time 1);where overlay color=(pixel color−(1−alpha)*underlay color)/alpha; wherepixel color corresponds to a blended color of the underlay color and theat least one overlay color at time 1 or at time 2; wherein alphacorresponds to the alpha blending factor; and wherein the overlay colorcorresponds to the color of the at least one overlay.
 17. The methodaccording to claim 16 further comprising varying the first and secondcolors to improve color contrast between the underlay color and the atleast one overlay color.
 18. The method according to claim 1 wherein themedia application comprises a real-time media application providingreal-time communications (RTC), and wherein redirecting the portion ofthe real-time media communications is based on injected JavaScript codefor WebRTC API redirection.
 19. A computing system comprising: at leastone video source to provide at least one video stream; and a servercomprising at least one processor configured to perform the following:execute a media application to provide media streaming that includes atleast one video stream and at least one overlay on the at least onevideo stream, redirect a portion of the media streaming by providing aplaceholder to indicate positioning geometry of the at least one videostream within a media window, with the placeholder to include the atleast one overlay, detect the placeholder and determine positioninggeometry associated therewith, and determine a color and an alphablending factor of the at least one overlay based on calculationsinvolving different colors of the at least one underlay at differenttimes.
 20. The computing system according to claim 19 further comprisinga client device comprising: a display to display the media window; and aprocessor configured to perform the following: communicate with saidserver through a virtual channel to execute the redirected portion ofthe media application, and receive the at least one video stream, thepositioning geometry of the at least one placeholder, and the color andthe alpha blending factor of the at least one overlay so as to overlaythe at least one video stream over the at least one placeholder withinthe displayed media window based on the positioning geometry, and tooverlay the at least one overlay in the color and alpha blending factorassociated therewith.